package com.bs.util;


import java.sql.ResultSet;
import com.dj.conn.DataBean;


public class SystemTree {
	public static String getSenicTree(String id){
		StringBuffer treeBuf = new StringBuffer("<tr>");
		DataBean db=new DataBean();
		ResultSet rs=null;
		rs=db.executeQuery("select id,name from project  where dept_id="+id);
		try {
			int i=1;
			while(rs.next()){
				if(i%4==0){
					treeBuf.append("<td><input type='checkbox' name='xm' value='"+rs.getString("name")+"'/>");
					 treeBuf.append(rs.getString("name")+"</td>");
					treeBuf.append("</tr><tr>");
				}else{
				 treeBuf.append("<td><input type='checkbox' name='xm' value='"+rs.getString("name")+"'/>");
				 treeBuf.append(rs.getString("name")+"</td>");
				}
				i++;
			}
			treeBuf.append("</tr>");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return treeBuf.toString();
	}
}
